import React, { Component } from 'react';
import Son from './son'

const TempButton = React.forwardRef((props, ref) => {
    console.log(props);
    return <Son/>
})

export default class Index extends Component {
    constructor(data) {
        super(data)
        this.tempRef = React.createRef()
    }
    // componentDidMount(){
    //     console.log(this.tempRef);
    // }
    render() {
        return (
            <div>
                <p>在这里发送ref</p>
                {/* <FancyButton ref={this.tempRef}>Click me!</FancyButton>; */}
                <TempButton test={1111}  ref={this.tempRef}/>
                {/* <Temp test={1111} ref={this.tempRef}>111111</Temp> */}
                {/* <Son temp={this.tempRef}/> */}
            </div>
        )
    }
}